package net.xdclass.websocket.controller.v2;

import net.xdclass.websocket.model.InMessage;
import net.xdclass.websocket.model.OutMessage;
import net.xdclass.websocket.service.WebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * @description: 游戏公告控制器
 * @author: Yz
 * @create: 2020-06-30 14:03
 **/
@Controller
public class V2GameInfoController {

    @Autowired
    private WebSocketService webSocketService;

    /**
     * 发送消息
     * @param message
     * @return
     */
    @MessageMapping("v2/chat")
    public void gameInfo(InMessage message){

        webSocketService.sendTopicMessage("/topic/game_rank",message);

    }
}
